package com.ydgk.dao;

import com.ydgk.bean.FurnitureKinds;
import com.ydgk.bean.KindsType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface KindsTypeMapper {

    @Insert("insert into kindstype values(#{ktid},#{ktname},#{ktface},#{k_kid})")
    int insert(KindsType kindsType);

    @Select("select * from kindstype where k_kid = #{kid}")
    List<KindsType> findAllByKid(int kid);

    @Select("select * from kindstype where ktid = #{ktid}")
    KindsType findById(int ktid);

    @Delete("delete from kindstype where ktid = #{ktid}")
    int deleteById(int ktid);

    @Update("update kindstype set ktname = #{ktname} , ktface = #{ktface} where ktid = #{ktid}")
    int updateById(KindsType kindsType);

    @Delete("delete from kindstype where k_kid = #{kid}")
    void deleteByKid(int kid);

    @Select("select * from kindstype where ktname = #{ktname}")
    KindsType findByKtname(String ktname);
}
